<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:app="http://springfuse.jaxio.com/app"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui" 
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:of="http://omnifaces.org/functions"	
	template="/WEB-INF/layouts/main.xhtml">
	<ui:param name="title" value="error_unknown_title" />
	<ui:define name="content">
		<p:panel header="${msg.error_unknown}">
		<h:panelGrid columns="2">		
			<h:outputText value="Date/time:" /> <h:outputText value="#{of:formatDate(now, 'yyyy-MM-dd HH:mm:ss')}" />
			<h:outputText value="User agent" /> <h:outputText value="#{header['user-agent']}" />
			<h:outputText value="User IP" /> <h:outputText value="#{empty header['x-forwarded-for'] ? request.remoteAddr : fn:split(header['x-forwarded-for'], ',')[0]}" />
			<h:outputText value="Request URI:" /> <a href="#{requestScope['javax.servlet.error.request_uri']}">#{requestScope['javax.servlet.error.request_uri']}</a>
			<h:outputText value="Ajax request" /> <h:outputText value="#{facesContext.partialViewContext.ajaxRequest ? 'Yes' : 'No'}" />
			<h:outputText value="Status code" /> <h:outputText value="#{requestScope['javax.servlet.error.status_code']}" />
			<h:outputText value="Exception type" /> <h:outputText value="#{requestScope['javax.servlet.error.exception_type']}" />
			<h:outputText value="Exception message" /> <h:outputText value="#{requestScope['javax.servlet.error.message']}" />
			<h:outputText value="Stack trace" /> <pre><code>#{of:printStackTrace(requestScope['javax.servlet.error.exception'])}</code></pre>
		</h:panelGrid>
		</p:panel>
	</ui:define>
</ui:composition>
